﻿using System.ComponentModel;

namespace System.Lua.Converters
{
    /// <summary>
    /// Marks custom <see cref="TypeConverter"/>s that convert .NET and Lua types.
    /// </summary>
    internal interface ILuaTypeConverter
    {
        /// <summary>
        /// Gets a value indicating whether the string returned by the converter is a valid Lua
        /// literal.
        /// </summary>
        bool ReturnsLiteral { get; }

        string ConvertToString(object value);
        object ConvertFromString(string value);

        bool CanConvertTo(Type targetType);
        object ConvertTo(object value, Type targetType);

        bool CanConvertFrom(Type type);
        object ConvertFrom(object value);
    }
}
